home *** CD-ROM | disk | FTP | other *** search
Wrap
ccccppppuuuusssseeeettttCCCCrrrreeeeaaaatttteeee((((3333xxxx)))) ccccppppuuuusssseeeettttCCCCrrrreeeeaaaatttteeee((((3333xxxx)))) NNNNAAAAMMMMEEEE cpusetCreate - create a cpuset SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS ####iiiinnnncccclllluuuuddddeeee <<<<ccccppppuuuusssseeeetttt....hhhh>>>> iiiinnnntttt ccccppppuuuusssseeeettttCCCCrrrreeeeaaaatttteeee((((cccchhhhaaaarrrr ****qqqqnnnnaaaammmmeeee,,,, ccccppppuuuusssseeeetttt____QQQQuuuueeeeuuuueeeeDDDDeeeeffff____tttt ****qqqqddddeeeeffff))));;;; DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN The _c_p_u_s_e_t_C_r_e_a_t_e function is used to create a cpuset queue. Only processes running root user ID are allowed to create cpuset queues. The qqqqnnnnaaaammmmeeee argument is the name that will be assigned to the new cpuset. The name of the cpuset must be a three to eight character string. Queue names having one or two characters are reserved for use by IRIX. The qqqqddddeeeeffff argument is a pointer to a ccccppppuuuusssseeeetttt____QQQQuuuueeeeuuuueeeeDDDDeeeeffff____tttt structure (defined in <cpuset.h>) that defines the attributes of the queue to be created. The memory for the ccccppppuuuusssseeeetttt____QQQQuuuueeeeuuuueeeeDDDDeeeeffff____tttt is allocated using _c_p_u_s_e_t_A_l_l_o_c_Q_u_e_u_e_D_e_f(3x) and it is released using _c_p_u_s_e_t_F_r_e_e_Q_u_e_u_e_D_e_f(3x). The ccccppppuuuusssseeeetttt____QQQQuuuueeeeuuuueeeeDDDDeeeeffff____tttt structure is defined as follows: typedef struct { int flags; char *permfile; cpuset_CPUList_t *cpu; } cpuset_QueueDef_t; ffffllllaaaaggggssss is used to specify various control options for the cpuset queue. It is formed by OR-ing together zero or more of the following values: _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______CCCC_PPPP_UUUU______EEEE_XXXX_CCCC_LLLL_UUUU_SSSS_IIII_VVVV_EEEE Defines a cpuset to be restricted. Only threads attached to the cpuset queue (descendents of an attached thread inherit the attachement) may execute on the CPUs contained in the cpuset. _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______MMMM_EEEE_MMMM_OOOO_RRRR_YYYY______LLLL_OOOO_CCCC_AAAA_LLLL Threads assigned to the cpuset will attempt to assign memory only from nodes within the cpuset. Assignment of memory from outside the cpuset will occur only if no free memory is available from within the cpuset. No restrictions are made on memory assignment to threads running outside the cpuset. _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______MMMM_EEEE_MMMM_OOOO_RRRR_YYYY______EEEE_XXXX_CCCC_LLLL_UUUU_SSSS_IIII_VVVV_EEEE Threads assigned to the cpuset will attempt to assign memory only from nodes within the cpuset. Assignment of memory from outside the cpuset will occur only if no free memory is available from within the cpuset. Threads not assigned to the cpuset will not use memory from within the cpuset unless no memory outside the cpuset is available. If, at the time a cpuset is created, memory is already assigned to threads that are already running, no PPPPaaaaggggeeee 1111 ccccppppuuuusssseeeettttCCCCrrrreeeeaaaatttteeee((((3333xxxx)))) ccccppppuuuusssseeeettttCCCCrrrreeeeaaaatttteeee((((3333xxxx)))) attempt will be made to explicitly move this memory. If page migration is enabled, the pages will be migrated when the system detects that most references to the pages are non-local. _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______MMMM_EEEE_MMMM_OOOO_RRRR_YYYY______KKKK_EEEE_RRRR_NNNN_EEEE_LLLL______AAAA_VVVV_OOOO_IIII_DDDD The kernel should attempt to avoid allocating memory from nodes contained in this cpuset. If kernel memory requests cannot be satisfied from outside this cpuset, this option will be ignored and allocations will occur from within the cpuset. (This avoidance currently extends only to keeping buffer cache away from the protected nodes.) _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______MMMM_EEEE_MMMM_OOOO_RRRR_YYYY______MMMM_AAAA_NNNN_DDDD_AAAA_TTTT_OOOO_RRRR_YYYY The kernel will limit all memory allocations to nodes that are contained in this cpuset. If memory requests cannot be satisfied, the allocating process will sleep until memory is available. The process will be killed if no more memory can be allocated. See policies below. _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______PPPP_OOOO_LLLL_IIII_CCCC_YYYY______PPPP_AAAA_GGGG_EEEE Requires MEMORY_MANDATORY. This is the default policy if no policy is specified. This policy will cause the kernel to page user pages to the swap file (see _s_w_a_p(1M)) to free physical memory on the nodes contained in this cpuset. If swap space is exhausted, the process will be killed. _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______PPPP_OOOO_LLLL_IIII_CCCC_YYYY______KKKK_IIII_LLLL_LLLL Requires MEMORY_MANDATORY. The kernel will attempt to free as much space as possible from kernel heaps, but will not page user pages to the swap file. If all physical memory on the nodes contained in this cpuset are exhausted, the process will be killed. The ppppeeeerrrrmmmmffffiiiilllleeee member is the name of the file that defines the access permissions for the cpuset queue. The file permissions of filename referenced by permfile define access to the cpuset. Every time permissions need to be checked, the current permissions of this file are used. Thus, it is possible to change the access to a particular cpuset without having to tear it down and recreate it, simply by changing the access permissions. Read access to the permfile allows a user to retrieve information about a cpuset, while execute permission allows the user to attach a process to the cpuset. The ccccppppuuuu member is a pointer to a ccccppppuuuusssseeeetttt____CCCCPPPPUUUULLLLiiiisssstttt____tttt structure. The memory for the ccccppppuuuusssseeeetttt____CCCCPPPPUUUULLLLiiiisssstttt____tttt structure is allocated and released when the ccccppppuuuusssseeeetttt____QQQQuuuueeeeuuuueeeeDDDDeeeeffff____tttt structure is allocated and released (see ccccppppuuuusssseeeettttAAAAllllllllooooccccQQQQuuuueeeeuuuueeeeDDDDeeeeffff(3x)). The ccccppppuuuusssseeeetttt____CCCCPPPPUUUULLLLiiiisssstttt____tttt structure contains the list of CPUs assigned to the cpuset. The ccccppppuuuusssseeeetttt____CCCCPPPPUUUULLLLiiiisssstttt____tttt structure (defind in <cpuset.h>) is defined as follows: typedef struct { int count; cpuid_t *list; PPPPaaaaggggeeee 2222 ccccppppuuuusssseeeettttCCCCrrrreeeeaaaatttteeee((((3333xxxx)))) ccccppppuuuusssseeeettttCCCCrrrreeeeaaaatttteeee((((3333xxxx)))) } cpuset_CPUList_t; The ccccoooouuuunnnntttt member defines the number of CPUs contained in the list. The lllliiiisssstttt member is pointer to the list (an allocated array) of the CPU IDs. The memory for the lllliiiisssstttt array is allocated and released when the ccccppppuuuusssseeeetttt____CCCCPPPPUUUULLLLiiiisssstttt____tttt structure is allocated and released. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS This example creates a cpuset queue that has access controled by the file /usr/tmp/mypermfile, contains CPU IDs 4, 8, and 12, is CPU exclusive and memory exclusive: cpuset_QueueDef_t *qdef; char *qname = "myqueue"; /* Alloc queue def for 3 CPU IDs */ qdef = cpusetAllocQueueDef(3); if (!qdef) { perror("cpusetAllocQueueDef"); exit(1); } /* Define attributes of the cpuset */ qdef->flags = CPUSET_CPU_EXCLUSIVE | CPUSET_MEMORY_EXCLUSIVE; qdef->permfile = "/usr/tmp/mypermfile" qdef->cpu->count = 3; qdef->cpu->list[0] = 4; qdef->cpu->list[1] = 8; qdef->cpu->list[2] = 12; /* Request that the cpuset be created */ if (!cpusetCreate(qname, qdef)) { perror("cpusetCreate"); exit(1); } cpusetFreeQueueDef(qdef); NNNNOOOOTTTTEEEESSSS _c_p_u_s_e_t_C_r_e_a_t_e is found in the library "libcpuset.so", and will be loaded if the option _----_llll_cccc_pppp_uuuu_ssss_eeee_tttt is used with _cccc_cccc(1) or _llll_dddd(1). SSSSEEEEEEEE AAAALLLLSSSSOOOO cpuset(1), cpusetAllocQueueDef(3x), cpusetFreeQueueDef(3x). cpuset(5). DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS If successful, _c_p_u_s_e_t_C_r_e_a_t_e returns a 1. If _c_p_u_s_e_t_C_r_e_a_t_e fails, it returns the value 0 and eeeerrrrrrrrnnnnoooo is set to indicate the error. The possible values for eeeerrrrrrrrnnnnoooo include those values set by ffffooooppppeeeennnn(3S), ssssyyyyssssmmmmpppp(2), and the PPPPaaaaggggeeee 3333 ccccppppuuuusssseeeettttCCCCrrrreeeeaaaatttteeee((((3333xxxx)))) ccccppppuuuusssseeeettttCCCCrrrreeeeaaaatttteeee((((3333xxxx)))) following: EEEENNNNOOOODDDDEEEEVVVV Request for CPU IDs that do not exist on the system. EEEEPPPPEEEERRRRMMMM Request for CPU 0 as part of an exclusive cpuset is not permitted. PPPPaaaaggggeeee 4444